package lium.lbs.lbsim.activity

import android.os.Bundle
import kotlinx.android.synthetic.main.activity_group_rqcode.*
import lium.lbs.lbsim.R
import lium.lbs.lbsim.bean.GroupInfoBean
import lium.lbs.lbsim.utils.EncodingHandler
import com.abbott.mutiimgloader.weixin.WeixinMerge;
import com.abbott.mutiimgloader.util.JImageLoader


class GroupRQCodeActivity : BaseActivity() {

    var groupInfoBean: GroupInfoBean? = null
    var groupId: String? = null
    var imageLoader: JImageLoader? = null
    var urls: List<String> = ArrayList()
    override fun getLayoutId(): Int {
        return R.layout.activity_group_rqcode
    }

    override fun initView(savedInstanceState: Bundle?) {
        setTitleWithBack("群二维码")
        groupInfoBean = intent.getSerializableExtra("QRcode") as GroupInfoBean?
        urls = intent.getStringArrayListExtra("urls")

    }


    fun setDataList() {
        imageLoader = JImageLoader(this)
        imageLoader!!.displayImages(urls, qun_image, WeixinMerge())
        tv_groupname.text = (groupInfoBean as GroupInfoBean).group.groupName
        val qrCodeBitmap = EncodingHandler.createQRCode((groupInfoBean as GroupInfoBean).group.qrcode, 350)
        rc_image.setImageBitmap(qrCodeBitmap)
    }

    override fun getNetWorkData() {
        setDataList()
    }
}
